
# include "dfxGraphicsDevice.h"

namespace DFX
{
    extern "C"
    {
        typedef DFXRESULT (*CREATEGRAPHICSDEVICE)(GraphicsDevice **gd);
    }

    class DFX_EXPORT GraphicsPlugin : public Singleton<GraphicsPlugin>, public Plugin
    {
    private:

        UInt32                  mHandle;
        String                  mDllFile;
        CREATEGRAPHICSDEVICE    mCreateGraphicsDevice;
        
    public:

        GraphicsPlugin(const String &dllFile);
        ~GraphicsPlugin();

        const String& GetDllFile() const
        {
            return mDllFile;
        }

        DFXRESULT CreateGraphicsDevice(GraphicsDevice **gd);
        
        DFXRESULT Load();
        DFXRESULT Unload();
    };
}